<?php
class Bootstrap extends Yaf_Bootstrap_Abstract{

    public function _initConfig() {
		$arrConfig = Yaf_Application::app()->getConfig();
		Yaf_Registry::set('config', $arrConfig);
	}

	public function _initPlugin(Yaf_Dispatcher $dispatcher) {
		$objSamplePlugin = new SamplePlugin();
		$dispatcher->registerPlugin($objSamplePlugin);
	}

	public function _initRoute(Yaf_Dispatcher $dispatcher) {
	}
	
	public function _initView(Yaf_Dispatcher $dispatcher){
	}
	
	public function _initDatabase()
	{
		Yaf_Registry::set('db', new Db());
	}

	public function _initSession()
	{
		Yaf_Registry::set('session', Yaf_Session::getInstance());
		Yaf_Registry::get("session")->start();
	}

	public function _initUtl()
	{
		Yaf_Registry::set('utl', new Utl());
	}

	public function _initReport()
	{
		/*$this->Session         = Yaf_Registry::get("session");
		$this->ReportModel     = new ReportModel();
		$this->CollectionModel = new CollectionModel();
		date_default_timezone_set('PRC');
        $arr     = array();
        $nowDate = time();
        for($i = 0; $i<7; $i++){
            $getTime = $nowDate-3600*24*$i;
            $arr[$i] = date("Y-m-d ",$getTime);
        }
        $pushArticle_info      = $this->ReportModel->selectPushInfoByTime($arr);
        $collArticle_info      = $this->CollectionModel->selectCollInfoByTime($arr);

        $collErrorArticle_info = $this->CollectionModel->selectCollErrorInfoByTime($arr);

        $pushErrorArticle_info = $this->ReportModel->selectPushErrorInfoByTime($arr);
		$this->Session->set('pushArticle_info', $pushArticle_info);

        $this->Session->set('collArticle_info', $collArticle_info);

        $this->Session->set('pushErrorArticle_info', $pushErrorArticle_info);
        
        $this->Session->set('collErrorArticle_info', $collErrorArticle_info);*/
        
        //->set('pushArticle_info', $pushArticle_info);

        /*$this->_initSession->set('collArticle_info', $collArticle_info);

        $this->_initSession->set('pushErrorArticle_info', $pushErrorArticle_info);
        
        $this->_initSession->set('collErrorArticle_info', $collErrorArticle_info);*/

		/*$this->ReportModel     = new ReportModel();
$this->CollectionModel = new CollectionModel();
date_default_timezone_set('PRC');
        $arr     = array();
        $nowDate = time();
        for($i = 0; $i<7; $i++){
            $getTime = $nowDate-3600*24*$i;
            $arr[$i] = date("Y-m-d ",$getTime);
        }
        $pushArticle_info      = $this->ReportModel->selectPushInfoByTime($arr);

        $collArticle_info      = $this->CollectionModel->selectCollInfoByTime($arr);

        $collErrorArticle_info = $this->CollectionModel->selectCollErrorInfoByTime($arr);

        $pushErrorArticle_info = $this->ReportModel->selectPushErrorInfoByTime($arr);

        
        $this->Session->set('pushArticle_info', $pushArticle_info);

        $this->Session->set('collArticle_info', $collArticle_info);

        $this->Session->set('pushErrorArticle_info', $pushErrorArticle_info);
        
        $this->Session->set('collErrorArticle_info', $collErrorArticle_info);*/
	}

	

}
